<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="../css/style2.css">
    <style>
    .notA a {
        color: #000;
    }

    /*加号*/
    .add_div {
        float: right;
        margin-right: -10px;
        margin-top: 3px;
        width: 26px;
        height: 26px;
        line-height: 26px;
        text-align: center;
        border: 1px solid #ccc;
        cursor: pointer;
        -webkit-transition: .4s all;
        transition: .4s all;
    }

    .add_div:hover {
        border: 1px solid #999;
    }

    /*小图片*/
    .img_pocket {
        height: 28px;
        cursor: pointer;
    }

    .layui-layer-btn0 {
        border-color: #20c0c7 !important;
        background-color: #20c0c7 !important;
    }

    .layui-layer-btn1,
    .layui-layer-btn2 {
        color: #333 !important;
    }

    #menu>li.container:hover {
        background-color: #ffffff;
    }

    .layui-tab>.layui-tab-title {
        overflow: hidden;
    }

    .unfold {
        width: 30px;
        height: 100%;
        background: #f5f5f5;
        position: absolute;
        top: 0px;
        right: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        transition: all 0.2s linear;
        display: none;
    }

    .unfold:hover {
        background: #dedede;
    }
    </style>
    <link rel="stylesheet" type="text/css" href="../layui/css/layui.css">
    <script src="../js/jquery.js"></script>
    <script type="text/javascript" src="../layui/layui.js"></script>
</head>

<body>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <div class="flip-switchTC">
                <div id="EyesightConditionTable">
                    <div>
                        <table class="layui-hide" id="EyesightCondition_n" lay-filter="test"></table>
                    </div>
                    <div class='box box_l' style='font-weight: 600;margin-top:25px;'><i class='circle' style='background:#666;'>!</i>历史眼部检查记录</div>
                    <div>
                        <table class="layui-hide" id="EyesightCondition_f" lay-filter="test"></table>
                    </div>
                </div>
                <div id="EyesightConditionChart">
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
var urlS = "http://27.150.171.149:2023";

function LeftEyeAndRightEyeF(eye) {
    if (!eye) { return ''; }
    var eyeArray = eye.split(','),
        eyeString = '';
    for (var i = 0; i < eyeArray.length; i++) {
        switch (eyeArray[i]) {
            case '0':
                eyeString = eyeString + ',左眼';
                break;
            case '1':
                eyeString = eyeString + ',右眼';
                break;
        }
    }
    return eyeString.substr(1);
}
</script>
<script type="text/html" id="EyesightConditionOP"><!-- 视力状态 -->
      <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-type='del'  tabId='EyesightCondition' url='/eyeinspect/{{d.id}}/' style='color:#fff;'>删除</a>
      <a class="layui-btn layui-btn-xs" lay-event="update" data-type="eyesightCondition" obj='{{JSON.stringify(d)}}' registernumber='t' tabId='EyesightCondition' url='/eyeinspect/{{d.id}}/' style='color:#fff;'>修改</a>
</script>
<script type="text/html" id="EyesightConditionDemo">
    <b style='font-weight: 600;'><i class='circle' style='background:#666;margin-top:6px;'>!</i>今日眼部检查记录</b>
        <div class='add_div' data-type='eyesightCondition' ifNew='true' registernumber='t' title='新增眼部检查记录'><i class="layui-icon layui-icon-add-circle"></i></div>
    </script>
<script type="text/html" id="left_eye_visionTpl">
    {{ highLow(d.left_eye_vision,"left_eye_vision") }}
</script>
<script type="text/html" id="right_eye_visionTpl">
    {{ highLow(d.right_eye_vision,"right_eye_vision") }}
</script>
<!-- 视力状态病变图像 -->
<script type="text/html" id="patient_identifierTpl">
    {{#  if(!d.left_lesion_pictures){ }}左眼：暂无
  {{#  } else{ }}左眼：<img class='img_pocket' src='{{urlS}}/media/{{ d.left_lesion_pictures}}'></img>
  {{#  } }}
  {{#  if(!d.right_lesion_pictures){ }}右眼：暂无
{{#  } else{ }}右眼：<img class='img_pocket' src='{{urlS}}/media/{{ d.right_lesion_pictures}}'></img>
  {{#  } }}
</script>
<!-- 左眼and右眼显示 -->
<script type="text/html" id="photocoagulationTpl">
    {{ LeftEyeAndRightEyeF(d.photocoagulation) }}
</script>
<script type="text/html" id="non_proliferative_retinopathyTpl">
    {{ LeftEyeAndRightEyeF(d.non_proliferative_retinopathy) }}
</script>
<script type="text/html" id="proliferative_retinopathyTpl">
    {{ LeftEyeAndRightEyeF(d.proliferative_retinopathy) }}
</script>
<script type="text/html" id="preproliferative_retinopathyTpl">
    {{ LeftEyeAndRightEyeF(d.preproliferative_retinopathy) }}
</script>
<script type="text/html" id="cataractTpl">
    {{ LeftEyeAndRightEyeF(d.cataract) }}
</script>
<script type="text/html" id="retinal_examinationTpl">
    {{ LeftEyeAndRightEyeF(d.retinal_examination) }}
</script>
<script type="text/html" id="macular_degenerationTpl">
    {{ LeftEyeAndRightEyeF(d.macular_degeneration) }}
</script>
<script type="text/html" id="diabetic_ophthalmopathyTpl">
    {{ LeftEyeAndRightEyeF(d.diabetic_ophthalmopathy) }}
</script>
<script type="text/javascript">
$(document).ready(function() {
    layui.jquery.ajaxSetup({
        headers: { "Authorization": 'JWT ' + "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNjA4NTM1NDkyLCJlbWFpbCI6IjQ2NTQ1NkBxcS5jb20ifQ.FVHlx0saZuHr-vKSlkTmWT1LZ4Mh2oEHbgnhDuizYZQ" }
    });
});

layui.use('element', function() {
    var element = layui.element;
});
layui.use('table', function() {
    var table = layui.table;
    table.render({
        elem: '#EyesightCondition_n',
        height: 'auto',
        toolbar: '#EyesightConditionDemo',
        url: urlS + '/eyeinspect/',
        where: { type: 'n', patient_id: 1106 },
        method: '',
        page: false,
        cols: [
            [
                { field: 'create_time', title: '创建日期', width: '120', sort: true, align: 'center' }, { field: 'left_eye_vision', title: '<span class="myCursorP" onclick="brokenLineF(`EyesightCondition`,`left_eye_vision`);">左眼视力 <i class="fa fa-area-chart"></i></span>', width: '100', align: 'center', templet: '#left_eye_visionTpl' }, { field: 'right_eye_vision', title: '<span class="myCursorP" onclick="brokenLineF(`EyesightCondition`,`right_eye_vision`);">右眼视力 <i class="fa fa-area-chart"></i></span>', width: '100', align: 'center', templet: '#right_eye_visionTpl' }, { field: 'photocoagulation', title: '光凝固检查', width: '120', align: 'center', templet: '#photocoagulationTpl' }, { field: 'non_proliferative_retinopathy', title: '非增生性视网膜病变', width: '120', align: 'center', templet: '#non_proliferative_retinopathyTpl' }, { field: 'proliferative_retinopathy', title: '增生性视网膜病变', width: '120', align: 'center', templet: '#proliferative_retinopathyTpl' }, { field: 'preproliferative_retinopathy', title: '增生前视网膜病变', width: '120', align: 'center', templet: '#preproliferative_retinopathyTpl' }, { field: 'cataract', title: '白内障', width: '120', align: 'center', templet: '#cataractTpl' }, { field: 'retinal_examination', title: '视网膜检查', width: '120', align: 'center', templet: '#retinal_examinationTpl' }, { field: 'macular_degeneration', title: '黄斑部病变', width: '120', align: 'center', templet: '#macular_degenerationTpl' }, { field: 'diabetic_ophthalmopathy', title: '晚期糖尿病眼疾', width: '120', align: 'center', templet: '#diabetic_ophthalmopathyTpl' }, { field: 'fundus_examination', title: '眼底检查', width: '120', align: 'center' }, { field: 'other_eye_examinations', title: '其他眼睛检查', width: '120', align: 'center' }, { field: 'report_results', title: '眼底报告结果', width: '120', align: 'center' }, { field: 'report_note', title: '眼底报告备注', width: '120', align: 'center' }, { field: 'patient_identifier', title: '病变图像', width: '120', align: 'center', templet: '#patient_identifierTpl' }, { title: '操作', width: '120', align: 'center', toolbar: '#EyesightConditionOP' }
            ]
        ],
        done: function(res, curr, count) {

        }
    });
    table.render({
        elem: '#EyesightCondition_f',
        height: 'auto',
        url: urlS + '/eyeinspect/',
        where: { type: 'f', patient_id: 1106 },
        method: '',
        page: true,
        cols: [
            [
                { field: 'create_time', title: '创建日期', width: '120', sort: true, align: 'center' }, { field: 'left_eye_vision', title: '<span class="myCursorP" onclick="brokenLineF(`EyesightCondition`,`left_eye_vision`);">左眼视力 <i class="fa fa-area-chart"></i></span>', width: '100', align: 'center', templet: '#left_eye_visionTpl' }, { field: 'right_eye_vision', title: '<span class="myCursorP" onclick="brokenLineF(`EyesightCondition`,`right_eye_vision`);">右眼视力 <i class="fa fa-area-chart"></i></span>', width: '100', align: 'center', templet: '#right_eye_visionTpl' }, { field: 'photocoagulation', title: '光凝固检查', width: '120', align: 'center', templet: '#photocoagulationTpl' }, { field: 'non_proliferative_retinopathy', title: '非增生性视网膜病变', width: '120', align: 'center', templet: '#non_proliferative_retinopathyTpl' }, { field: 'proliferative_retinopathy', title: '增生性视网膜病变', width: '120', align: 'center', templet: '#proliferative_retinopathyTpl' }, { field: 'preproliferative_retinopathy', title: '增生前视网膜病变', width: '120', align: 'center', templet: '#preproliferative_retinopathyTpl' }, { field: 'cataract', title: '白内障', width: '120', align: 'center', templet: '#cataractTpl' }, { field: 'retinal_examination', title: '视网膜检查', width: '120', align: 'center', templet: '#retinal_examinationTpl' }, { field: 'macular_degeneration', title: '黄斑部病变', width: '120', align: 'center', templet: '#macular_degenerationTpl' }, { field: 'diabetic_ophthalmopathy', title: '晚期糖尿病眼疾', width: '120', align: 'center', templet: '#diabetic_ophthalmopathyTpl' }, { field: 'fundus_examination', title: '眼底检查', width: '120', align: 'center' }, { field: 'other_eye_examinations', title: '其他眼睛检查', width: '120', align: 'center' }, { field: 'report_results', title: '眼底报告结果', width: '120', align: 'center' }, { field: 'report_note', title: '眼底报告备注', width: '120', align: 'center' }, { field: 'patient_identifier', title: '病变图像', width: '120', align: 'center', templet: '#patient_identifierTpl' }, { title: '操作', width: '120', align: 'center', toolbar: '#EyesightConditionOP' }
            ]
        ],
        done: function(res, curr, count) {

        }
    });
})
</script>

</html>